<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>倒计时跳转</title>
		<script>
			var a=10;
			function daojishi()
			{
				document.getElementById("b").innerHTML=a+"秒钟后自动跳转！";
				a--;
				if(a==0)
				{
					location.assign("https://www.baidu.com/");
				}
			}
			setInterval("daojishi()",1000);
			//setInterval() 方法可按照指定的周期（以毫秒计）来调用函数或计算表达式。
		</script>
	</head>
	<body>
		<div id="b"></div>
	</body>
</html>
